package cn.lg.soar.system.general.entity;

import cn.lg.soar.core.util.easyexcel.converters.BooleanConverter;
import cn.lg.soar.database.base.entity.IBaseEntity;
import cn.lg.soar.database.base.entity.ITenantEntity;
import com.alibaba.excel.annotation.ExcelProperty;
import com.baomidou.mybatisplus.annotation.*;
import com.fasterxml.jackson.annotation.JsonIgnore;
import com.fasterxml.jackson.annotation.JsonProperty;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Getter;
import lombok.Setter;

import java.time.LocalDateTime;

/**
 * 岗位
 * @author luguoxiang
 * @date 2022/4/12
 * 开源项目：https://gitee.com/lgx1992/lg-soar 求star！请给我star！请帮我点个star！
 */
@Getter
@Setter
@ApiModel(value = "UserTag", description = "用户标签")
@TableName("lg_sys_user_tag")
public class UserTag implements ITenantEntity {

    private static final long serialVersionUID = -652064669650119926L;

    @ApiModelProperty(value = "主键")
    @TableId
    private Long id;

    @ApiModelProperty(value = "所属用户id")
    private Long userId;

    @ApiModelProperty(value = "名称")
    private String name;

    @ExcelProperty(value = "是否禁用", converter = BooleanConverter.class)
    private Boolean disabled;

    @ExcelProperty(value = "标签用户数量", converter = BooleanConverter.class)
    private Integer count;

    @ApiModelProperty(value = "租户id")
    @JsonIgnore
    @TableField(select = false)
    private Integer tenantId;

    @JsonProperty(access = JsonProperty.Access.READ_ONLY)
    @ApiModelProperty(value = "创建时间")
    @TableField(value = IBaseEntity.CREATE_TIME, fill = FieldFill.INSERT, updateStrategy = FieldStrategy.NEVER)
    protected LocalDateTime createTime;

    @JsonProperty(access = JsonProperty.Access.READ_ONLY)
    @ApiModelProperty(value = "更新时间")
    @TableField(value = IBaseEntity.UPDATE_TIME, fill = FieldFill.INSERT_UPDATE)
    protected LocalDateTime updateTime;

}
